﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BneyBaruch.Ingest.MorningLesson.Contracts.Interfaces;
using System.ServiceModel;
using BneyBaruch.Ingest.MorningLesson.Contracts.Messages;
using System.Windows.Forms;
using System.Threading;

namespace BneyBaruch.Ingest.MorningLesson.WorkflowManagerServices
{
    [ServiceBehavior
        (
            InstanceContextMode = InstanceContextMode.Single,
            ConcurrencyMode = ConcurrencyMode.Reentrant
        )
    ]
    public class MorningLessonWorkflowManager : IMorningLessonWorkflowManager
    {
        #region IMorningLessonWorkflowManager Members

        public void RequestManagerForMatrixAdjustment(RequestManagerForMatrixAdjustmentRequest request)
        {
            MessageBox.Show(request.RequestMessage);

            IMorningLessonWorkflowManagerCallback caller = 
                OperationContext.Current.GetCallbackChannel<IMorningLessonWorkflowManagerCallback>();
            caller.ApproveMatrixAdjustment(request.WorkflowId);
        }

        #endregion
    }
}
